/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --background-color: #f5f7fa;
    --card-background: rgba(255, 255, 255, 0.98);
    --text-color: #2c3e50;
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

body {
    background: var(--background-color) url("images/background.png") no-repeat center;
    background-attachment: fixed;
    background-size: cover;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}

.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-speed);
}

.card:hover {
    transform: translateY(-5px);
}

/* 标题样式 */
h1 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* 问题列表样式 */
.question-list {
    list-style: none;
    margin: 2rem 0;
}

.question-list li {
    margin-bottom: 1rem;
    transition: all var(--transition-speed);
}

.question-list a {
    display: block;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.question-list a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* 投票表单样式 */
.choices {
    margin: 2rem 0;
}

.choice-item {
    margin-bottom: 1rem;
    position: relative;
}

.choice-item input[type="radio"] {
    display: none;
}

.choice-item label {
    display: block;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
}

.choice-item label:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
}

.choice-item input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-speed);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn.primary {
    background: var(--primary-color);
    color: white;
}

.btn.secondary {
    background: var(--secondary-color);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 结果页面样式 */
.results-card {
    padding: 2rem;
}

.results-list {
    margin: 2rem 0;
}

.result-item {
    margin-bottom: 1.5rem;
}

.result-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.choice-text {
    font-weight: 500;
}

.vote-count {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-container {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 1s ease-in-out;
}

/* 导航链接 */
.nav-links {
    margin-top: 2rem;
    text-align: center;
}

.nav-links .btn {
    margin: 0 0.5rem;
}

/* 错误消息 */
.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

/* 管理链接 */
.admin-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.admin-link:hover {
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .container {
        margin: 10px;
    }

    .card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeIn 0.5s ease-out;
}

/* 无投票时的样式 */
.no-polls {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* 表单操作区域 */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* 字段集样式 */
fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

legend {
    width: 100%;
    margin-bottom: 1.5rem;
}